package Z03JiHeKuangJia.ArrayListStudy.T03ListJieKou;

import java.util.ArrayList;
import java.util.List;

public class ListJieKou1 {}

class TestListJieKou{
    public static void main(String[] args) {
        //ArrayList实现了接口List
        //常见的写法会把引用声明为接口List类型
        //注意：是java.util.List,而不是java.awt.List
        //接口引用指向子类对象(多态)
        List Heros = new ArrayList();
        Heros.add(new Hero("盖伦"));
        System.out.println(Heros.size());
    }
}


class Hero{
    public String name;
    public float hp;

    public int damage;
    // 数组的局限性
    public Hero(){


    }

    public Hero(String name){
        this.name = name;
    }

    public String toString(){
        return name;
    }
}
